<template>
  <el-table-column :="attrs" :prop="props.prop">
    <template #default="{ row }">
      <ElRate disabled size="small" :model-value="getValue(row)" />
    </template>
  </el-table-column>
</template>

<script setup lang="ts">
import { useAttrs } from 'vue'
const attrs = useAttrs()

interface Props {
  prop?: string;
}

const props = defineProps<Props>()

const getValue= (row) => {
  if (!row || !row[props.prop as any]) return []
  return JSON.parse(row[props.prop as any])
}
</script>
